# 爬楼梯

class Solution:

    def climbStairs(self, n):
        dp = [0] * n
        if n == 1:
            
            return 1
        dp[0] = 1
        if n == 2:
            return 2
        dp[1] = 2
        if n+1 <= 2:


            return dp[-1]
        else:
            for i in range(2, n):
                dp[i] = dp[i - 1] + dp[i - 2]


        return dp[-1]

